<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
  
</head>
<style>
    #loding{
      width: 200px;
      height: 200px;
      background-color: darkorange;
      color: white;
      display: none;
    }
</style>
<body>
    <div id="loding">loding...</div>
    <script>

//加入加载一个111.js文件
function lode_js(file){
       new Promise((resolve,reject)=>{
              file.onlode=resolve();
               file.onerror=reject();
       }).then(value=>{
      setTimeout(() => {
        let div=document.querySelector("#loding");
               div.style.display="block";
      }, 2000);
       },reason=>{
               console.log(reson.message);
       }).finally(()=>{
     
           setTimeout(() => {
            let div=document.querySelector("#loding");
               div.style.display="none";
           }, 3000);
       })
    }
    lode_js("./111.js");
    </script>
</body>
</html>